package com.maiworld.seller.controller;

import java.util.Date;

import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import com.alibaba.dubbo.config.annotation.Reference;
import com.maiworld.content.service.AnswerFeedbackService;
import com.maiworld.pojo.AnswerFeedback;


import entity.PageResult;
import entity.Result;

@RestController
@RequestMapping("/answerFb")
public class AnswerFbController {

	@Reference
	private AnswerFeedbackService answerFeedbackService;
	
	@RequestMapping(value = "/search",method =RequestMethod.POST)
	public PageResult search(@RequestBody AnswerFeedback answerFeedback,@RequestParam("page") int page,@RequestParam("rows") int rows) {
		return answerFeedbackService.searchAnswerFeedbackList(answerFeedback, page, rows);
	}
	
	@RequestMapping(value = "/update",method =RequestMethod.POST)
	public Result update(@RequestBody AnswerFeedback answerFeedback) {
		Result success = new Result(false,"添加失败");		 
		int row = answerFeedbackService.updateAnswerFeedback(answerFeedback);
		if(row > 0) {
			success.setSuccess(true);
			success.setMessage("已通知");
		}else {
			
		}
		return success;
	}
	
}
